<extend name="../layout" />

<block name="main_content">
    <div class="row-fluid paper-edit-box">
        <div class="span3">
            <div class="widget-box">
                <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
                    <h5>{:L(MODULE_NAME)}{:L('meta_data')}</h5>
                    <a href="#view_workflow_processes_box" data-toggle="modal" class="label label-info">{:L("view_workflow_processes")}</a>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered table-striped with-check">
                        <tbody>
                            <tr>
                                <th style="width:80px;">ID</th>
                                <td>{$thePaper.id}</td>
                            </tr>
                            <tr>
                                <th>{:L('subject')}</th>
                                <td>{$thePaper.subject}</td>
                            </tr>
                            <tr>
                                <th>{:L('create_dateline')}</th>
                                <td>{$thePaper.dateline_lang}</td>
                            </tr>
                            <tr>
                                <th>{:L('status')}</th>
                                <td><span class="badge badge-{$thePaper.processes.currentNode.status_class}">{$thePaper.processes.currentNode.status_text}</span></td>
                            </tr>
                            <tr>
                                <th>{:L('sponsor')}</th>
                                <td>{$thePaper.sponsor}</td>
                            </tr>
                            <tr>
                                <th>{:L('stock')}</th>
                                <td>{$thePaper.stock_name}</td>
                            </tr>
                            <tr>
                                <th>{:L('memo')}</th>
                                <td>{$thePaper.memo}</td>
                            </tr>
                        </tbody>
                    </table>
               </div>
            </div>
        </div>
        <div class="span9">
            <div class="widget-box">
                <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
                    <h5>{:L(MODULE_NAME)}{:L('view_detail')}</h5>
                    <a href="{:U('index')}" class="label label-info">{:L('go_back')}</a>
                </div>
                <div class="widget-content nopadding">
                    
                    <table class="table table-bordered table-striped with-check">
                      {$TableView}
                      <tfoot>
                          <tr>
                              <th colspan="5">
                                  <volist name="thePaper[processes][nextActions]" id="lpn">
                                      <a href="{:U('/JXC/'.MODULE_NAME.'/doWorkflow/node_id/'.$lpn[id].'/mainrow_id/'.$thePaper[id])}" class="btn btn-{$lpn.btn_class}">{$lpn.name}</a> &nbsp;
                                  </volist>
                                  <a href="javascript:history.go(-1);" class="btn btn-info">{:L('go_back')}</a>
                              </th>
                              <td colspan="5">
                                  <if condition="$thePaper[total_num]">
                                  {:L('total_num')}
                                  <span class="label label-important" id="total_num">{$thePaper.total_num}</span>
                                  </if>
                                  <if condition="$thePaper[total_price]">
                                  {:L('total_price')}
                                  <span class="label label-info" id="total_num">{$thePaper.total_price}</span>
                                  </if>
                                  <if condition="$thePaper[total_price_real]">
                                  {:L('total_price_real')}
                                  <span class="label label-success" id="total_num">{$thePaper.total_price_real}</span>
                                  </if>
                              </td>
                          </tr>
                      </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>
    
    <div class="modal hide" id="view_workflow_processes_box">
        <div class="modal-header">
            <button data-dismiss="modal" class="close" type="button">×</button>
            <h3>{:L("view_workflow_processes")}</h3>
        </div>
        <div class="modal-body">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>{:L("dateline")}</th>
                        <th>{:L("operator")}</th>
                        <th>{:L("status")}</th>
                        <th>{:L("memo")}</th> 
                    </tr>
                </thead>
                <volist name="workflowProcesses" id="wp">
                    <tr>
                        <td>{$wp.start_time|toDate="m-d H:i"}</td>
                        <td>{$wp.user_id|toTruename}</td>
                        <td>{$wp.status_text}</td>
                        <td>{$wp.memo}</td>
                    </tr>
                </volist>
            </table>
        </div>
        <div class="modal-footer">
            <a data-dismiss="modal" class="btn dismissModal" href="#">{:L("close")}</a> 
        </div>
        
    </div>
</block>
